package com.job.createType.singleton.idler;

/**
 * @Author 王博
 * @DateTime 2025-03-31 10:19
 */
public class Instance {
    private static volatile Instance instance;

    private Instance(){}

    public static Instance getInstance(){
        if (instance == null){
            instance = new Instance();
        }
        return instance;
    }

    public static synchronized Instance getInstance1(){
        if (instance == null){
            instance = new Instance();
        }
        return instance;
    }

    public static Instance getInstance2(){
        if (instance == null){
            synchronized (Instance.class) {
                if (instance == null){
                    instance = new Instance();
                }
            }
        }
        return instance;
    }
}
